<!-- 正文开始 -->
<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-card-body">
      <!-- 头部操作栏 -->
      <form class="layui-form">
        <div class="layui-form lay-header">
          <div class="toolbar">
            <div class="layui-form-item lay-query-content">
              <div class="lay-query-box">
                <div class="query-lt">
                  <!-- <div class="layui-inline">
                    <label class="layui-form-label w-auto">工序：</label>
                    <div class="layui-input-inline">
                      <select name="processId" id="selectProcessId">
                        <option value="">选择工序</option>
                      </select>
                    </div>
                  </div> -->
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">质检任务编号：</label>
                    <div class="layui-input-inline">
                      <input name="code" class="layui-input" type="text" placeholder="请输入质检任务编号" />
                    </div>
                  </div>
                  <!-- <div class="layui-inline">
                    <label class="layui-form-label w-auto">产品类别：</label>
                    <div class="layui-input-inline">
                      <div
                        style="margin-left: 33px; width: 84%"
                        id="productTypeName"
                        lay-filter="productTypeName"
                      ></div>
                      <input
                        id="productTypeId"
                        name="productTypeId"
                        type="hidden"
                      />
                    </div>
                  </div> -->
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">任务状态：</label>
                    <div class="layui-input-inline">
                      <select name="">
                        <option value="">请选择</option>
                        <option value="inspect">送检中</option>
                        <option value="finish">完成</option>
                        <option value="confirm">待认领</option>
                        <!-- <option value="close">关闭</option> -->
                      </select>
                    </div>
                  </div>
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">报工单编号：</label>
                    <div class="layui-input-inline">
                      <input name="reportOrderCode" class="layui-input" type="text" placeholder="请输入报工单编号" />
                    </div>
                  </div>
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">质检分类：</label>
                    <div class="layui-input-inline">
                      <select name="qualityTestingCategoryId">
                        <option value="">全部</option>
                        <option value="1">化学检测</option>
                        <option value="2">外观检测</option>
                        <option value="3">物理检测</option>
                        <option value="4">其他检测</option>
                      </select>
                    </div>
                  </div>
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">质检类型：</label>
                    <div class="layui-input-inline">
                      <select name="qcQualityTypeId">
                        <option value="">全部</option>
                        <option value="1">来料质检(IQC)</option>
                        <option value="2">工序质检(IPQC)</option>
                        <option value="3">成品质检(FQC)</option>
                        <option value="4">出库检</option>
                      </select>
                    </div>
                  </div>
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">任务添加时间：</label>
                    <div class="layui-input-inline">
                      <input name="createTime" id="createTime" class="layui-input date-icon" type="text" placeholder="请选择任务添加时间" style="width: 200px" readonly />
                    </div>
                    <input name="startCreateTime" id="sCreateTime" type="hidden" />
                    <input name="endCreateTime" id="eCreateTime" type="hidden" />
                  </div>
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">送检人：</label>
                    <div class="layui-input-inline">
                      <input name="inspector" class="layui-input" type="text" placeholder="请输入送检人" />
                    </div>
                  </div>
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">认领人：</label>
                    <div class="layui-input-inline">
                      <input name="getName" class="layui-input" type="text" placeholder="请输入认领人" />
                    </div>
                  </div>
                  <div class="layui-inline">
                    <label class="layui-form-label w-auto">车间：</label>
                    <div class="layui-input-inline">
                      <input name="workshopName" class="layui-input" type="text" placeholder="请输入车间" />
                    </div>
                  </div>
                </div>
                <div class="query-rt">
                  <div class="layui-inline">
                    <button type="button" class="layui-btn icon-btn color-green" lay-filter="formSubSearchLog" lay-submit>查询</button>
                    <button class="layui-btn icon-btn color-white" lay-filter="resets" lay-submit type="button">重置</button>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="lay-btn-rows">
            <div class="lay-btn-box">
              <div class="lay-btn-lt">
                <button id="workOrderQualityTestingTaskBtnAdd" class="layui-btn icon-btn color-reseda" type="button">添加质检任务</button>
              </div>
              <div class="lay-btn-rt"></div>
            </div>
          </div>
        </div>
      </form>
      <!-- 表格 -->
      <table class="layui-table" id="workOrderQualityTaskTable" lay-filter="workOrderQualityTaskTable"></table>
    </div>
  </div>
</div>

<style>
  .bac{
    background-color: rgb(229, 229, 229);
  }
  .name {
    overflow: hidden;
    word-break: break-word;  /* 强制换行（包括长单词和数字） */
    white-space: normal;     /* 允许换行 */
  }
  .td{
    overflow: hidden;
    word-break: break-word;  /* 强制换行（包括长单词和数字） */
    white-space: normal;  
  }
  div[lay-id="addQualityInspectionTaskTable"] .layui-form,
  div[lay-id="addQualityInspectionTaskTable"] .layui-table-box,
  div[lay-id="addQualityInspectionTaskTable"] .layui-table-body,
  div[lay-id="addQualityInspectionTaskTable"] .layui-table-cell {
    overflow: visible;
  }

  div[lay-id="addQualityInspectionTaskTable"] .layui-table-cell {
    padding: 10px;
    height: auto;
  }

  xm-select {
    margin-left: -21%;
    width: 190px;
    min-height: 32px;
    line-height: 32px;
  }
</style>

<!-- 表格操作列 -->
<script type="text/html" id="workOrderQualityTestingTaskTableBar">
  <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="details">详情</a>
  <!-- {{# if(d.whetherEdit=="0" && d.status=="inspect"){ }} -->
  <!--          <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="print">打印</a>-->
  <!-- <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="close">关闭</a> -->
  <!-- {{# }else if(d.whetherEdit=="0" && d.status=="finish"){ }} -->
  <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="details">详情</a> -->
  <!--          <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="print">打印</a>-->
  <!-- {{# }else if(d.whetherEdit=="0" && d.status=="confirm"){ }} -->
  <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="details">详情</a> -->
  <!--          <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="print">打印</a>-->
  <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="edit">修改</a>
  <a class="layui-btn layui-btn-xs" lay-event="determine">认领</a>
  <!-- {{# }else if(d.whetherEdit=="0" && d.status=="close"){ }} {{# } }} -->
  <!-- {{# if( d.status=="inspect"){ }} -->

  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="close">关闭</a>
  <!-- {{# } }} -->

  <button class="layui-btn  layui-btn-xs" lay-event="print">打印</button>
</script>

<!--添加质检任务弹窗-->
<script id="addQualityInspectionTaskTemplate" type="text/html">
  <form lay-filter="addQualityInspectionTaskForm" class="layui-form model-form form-scroll">
    <div class="open-details-box pd-20">
      <input name="id" type="hidden" />
      <div class="layui-form-item" style="margin: 20px 0;" id="productionPlanIdBox">
        <label class="layui-form-label w-auto">选择开工单：</label>
        <div class="layui-input-inline">
          <input name="productionPlanId" id="productionPlanId" class="layui-input" type="text" placeholder="请选择开工单" readonly="readonly" style="cursor: pointer;" />
        </div>
      </div>
      <div class="layui-form-item" style="margin: 20px 0;" id="productionPlanRecordIdBox">
        <label class="layui-form-label w-auto">选择报工单：</label>
        <div class="layui-input-inline">
          <input
            name="productionPlanRecordId"
            id="productionPlanRecordId"
            class="layui-input"
            type="text"
            placeholder="请选择报工单"
            readonly="readonly"
            style="cursor: pointer;" />
        </div>
      </div>
      <div class="layui-form-item" id="addQualityInspectionTaskTableBox" style="display: none;">
        <div class="open-details-title">开工单信息</div>
      </div>
      <div class="layui-form-item" id="addQualityInspectionTaskRemarkBox" style="display: none;">
        <label class="layui-form-label w-auto">送检备注说明：</label>
        <div class="layui-input-block" style="margin-left: 130px">
          <textarea placeholder="送检备注说明" name="remark" style="resize: none; padding: 10px;width: 100%;min-height: 80px;box-sizing: border-box"></textarea>
        </div>
      </div>
    </div>
    <div class="layui-form-item text-right pd-20">
      <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
      <button class="layui-btn" lay-filter="addQualityInspectionTaskSubmit" lay-submit style="display: none;">提交</button>
    </div>
  </form>
</script>

<script type="text/html" id="addQualityInspectionTaskTableBar">
  <a class="layui-btn  layui-btn-xs" lay-event="print">打印标签</a>
</script>

<!--打印-->
<script type="text/html" id="printPurchaseSignForTemplate">
  <form lay-filter="printPurchaseSignForTemplateForm" class="layui-form open-form printTemplateForm">
    <div class="open-model">
      <div class="open-auto">
        <div class="my-print-box" id="printHtml">

        </div>
      </div>
      <div class="layui-form-item text-right">
        <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        <button class="layui-btn" type="button" id="printPurchaseSignFor">打印</button>
      </div>
    </div>
  </form>
</script>
<script src="/admin/assets/libs/jquery/jquery-3.2.1.min.js"></script>
<script src="/admin/assets/libs/jquery/jQuery.print.js.js"></script>

<!--选择开工单-->
<script type="text/html" id="selectTheWorkProcessTemplate">
  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body">
        <!-- 头部操作栏 -->
        <div class="layui-form toolbar">
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label w-auto">开工单编号：</label>
              <div class="layui-input-inline mr0" style="width: 240px;">
                <input name="code" class="layui-input" type="text" placeholder="开工单编号" />
              </div>
            </div>
            <div class="layui-inline">
              <button class="layui-btn icon-btn" lay-filter="selectTheWorkProcessFormSubSearchLog" lay-submit style="padding: 0 24px;">搜索</button>
              <button id="selectTheWorkProcessClose" class="layui-btn icon-btn">确认选择</button>
            </div>
          </div>
        </div>
        <!-- 表格 -->
        <table class="layui-table" id="selectTheWorkProcessTable" lay-filter="selectTheWorkProcessTable"></table>
      </div>
    </div>
  </div>
</script>

<!-- js部分 -->
<script>
    layui.use(["layer", "form", "table", "admin", "laydate"], function () {
      var $ = layui.jquery;
      var layer = layui.layer;
      var form = layui.form;
      var table = layui.table;
      var config = layui.config;
      var admin = layui.admin;
      var upload = layui.upload;
      var laydate = layui.laydate;

      form.render("select");

      //初始化产品类别
      // admin.initDataSelectTree(
      //   true,
      //   "enterprise/product/admin/productType/getTreeData",
      //   { materialNatureList: [2, 3, 7] },
      //   "productTypeName",
      //   null,
      //   "物料分类",
      //   "productTypeId",
      //   null
      // );

      laydate.render({
        elem: "#createTime",
        type: "date",
        range: true,
        done: function (value, date, endDate) {
          if (value) {
            var dateValue = value.split(" - ");
            $("input[name='startCreateTime']").val(dateValue[0] + " 00:00:00");
            $("input[name='endCreateTime']").val(dateValue[1] + " 23:59:59");
          } else {
            $("input[name='startCreateTime']").val("");
            $("input[name='endCreateTime']").val("");
          }
        },
      });

      // 渲染表格
      var insTb = table.render({
        elem: "#workOrderQualityTaskTable",
        url: config.base + "production/quality/admin/workOrderQualityTask/list",
        page: true,
        cellMinWidth: 100,
        cols: [
          [
            { type: "numbers", title: "序号" },
            { field: "code", title: "质检任务编码",width: 150  },
            // { field: "processName", title: "所属计划" },
            // { field: "workOrderCode", title: "所属开工单" },
            { field: "reportOrderCode", title: "所属报工单",width: 150 },

            { field: "testingCategoryName", title: "质检分类" },
            { field: "testingTypeName", title: "质检性质" },
            { field: "qcQualityTypeName", title: "质检类型" },
            // { field: "skuCode", title: "物料编码" },
            { field: "submissionQuantity", title: "送检数量", },
            { field: "detectionQuantity", title: "抽检数量", },
            { field: "qualifiedQuantity", title: "合格数", },
            { field: "notQuantity", title: "不合格数", },
            { field: "okRate", title: "合格率(%)", },
            { field: "statusDesc", title: "状态" },
            { field: "creatorName", title: "报验人" },
            { field: "createTime", title: "报验时间" },
            { field: "batchNumber", title: "批次号" },
            {
              align: "center",
              toolbar: "#workOrderQualityTestingTaskTableBar",
              title: "操作",
              fixed: "right",
              width: 260,
            },
          ],
        ],
        done: function (res, curr, count) {
          //移除按钮
        },
      });

      // 工序名称2
      // admin.req(
      //   "enterprise/product/admin/processInfo/getAllProcessInfo",
      //   {},
      //   function (res) {
      //     if (res.code == 200) {
      //       $.each(res.data, function (index, item) {
      //         $("#selectProcessId").append(new Option(item.nodeNames, item.id));
      //       });
      //       form.render("select");
      //     } else {
      //       layer.msg(res.msg, { icon: 2 });
      //     }
      //   },
      //   "GET"
      // );
      // 工具条点击事件
      table.on("tool(workOrderQualityTaskTable)", function (obj) {
        let data = obj.data;
        if (obj.event === "edit") {
          //修改
          showQualityInspectionTaskModel(data, "edit");
        } else if (obj.event === "del") {
          // 删除
          doDelete(obj);
        } else if (obj.event === "details") {
          showQualityInspectionTaskModel(data, "details");
        } else if (obj.event === "print") {
          // doPrint(obj);
          showPrintPurchaseSignForTemplate(data)
        } else if (obj.event === "close") {
          doClose(data);

        } else if (obj.event === "determine") {
          showQualityInspectionTaskModel(data, "determine");
        }
      });

      //监听排序
      table.on("sort(workOrderQualityTaskTable)", function (obj) {
        table.reload("workOrderQualityTaskTable", {
          initSort: obj,
          where: {
            sort: obj.field,
            order: obj.type,
          },
        });
      });

      // 搜索
      form.on("submit(formSubSearchLog)", function (data) {
        insTb.reload({ where: data.field, page: { curr: 1 } }, "data");
      });

      // 重置搜索
      form.on("submit(resets)", function (data) {
        insTb.reload(
          { where: admin.resetSearch(data.field), page: { curr: 1 } },
          "data"
        );
        return false;
      });

      // 添加按钮点击事件
      $("#workOrderQualityTestingTaskBtnAdd").click(function () {
        showQualityInspectionTaskModel();
      });

      // 添加质检任务弹窗 && 质检任务详情弹窗
      function showQualityInspectionTaskModel(data, _type) {
        //如果是详情 或者是 修改
        if (data) {
          data.type = _type;
          admin.putTempData("workOrderQuaTaskInfoData", data);
        } else {
          admin.putTempData("workOrderQuaTaskInfoData", null);
        }

        let title = "";
        //data ? (_type === 'details' ? '送检任务详情' : '修改质检任务') : '添加质检任务'
        if (data) {
          if (_type === "details") {
            title = "质检任务详情";
            admin.formOpen({
              type: 1,
              area: ["80%", "85%"],
              style: "font-size: 20px;",
              title: title,
              path: "components/res/quality/workOrderQualityTaskDetailForm.html",
              finish: function () {
                table.reload(insTb, {});
              },
            });
          } else if (_type === "determine") {
            title = "质检任务认领";
            admin.formOpen({
              type: 1,
              area: ["80%", "85%"],
              style: "font-size: 20px;",
              title: title,
              path: "components/res/quality/workOrderQualityTaskForm.html",
              finish: function () {
                table.reload(insTb, {});
              },
            });
          } else {
            title = "修改质检任务";
            admin.formOpen({
              type: 1,
              area: ["80%", "85%"],
              style: "font-size: 20px;",
              title: title,
              path: "components/res/quality/workOrderQualityTaskForm.html",
              finish: function () {
                table.reload(insTb, {});
              },
            });
          }
        } else {
          title = "添加质检任务";
          admin.formOpen({
            type: 1,
            area: ["80%", "85%"],
            style: "font-size: 20px;",
            title: title,
            path: "components/res/quality/workOrderQualityTaskForm.html",
            finish: function () {
              table.reload(insTb, {});
            },
          });
        }
      }

      // 删除
      function doDelete(obj) {
        layer.confirm(
          "确定要删除吗？",
          {
            offset: "65px",
            skin: "layui-layer-admin",
          },
          function (i) {
            layer.close(i);
            layer.load(2);
            admin.req(
              "production/qualityTesting/admin/workOrderQualityTestingTask/" +
                obj.data.id,
              {},
              function (res) {
                layer.closeAll("loading");
                if (res.code == 200) {
                  layer.msg(res.msg, { icon: 1 });
                  obj.del();
                } else {
                  layer.msg(res.msg, { icon: 2 });
                }
              },
              "DELETE"
            );
          }
        );
      }

      function jsToFormData(config) {
        const formData = new FormData();
        Object.keys(config).forEach((key) => {
          formData.append(key, config[key]);
        });

        return formData;
      }

      // 关闭工单
      function doClose(data) {
        layer.confirm(
          "确定要关闭吗？",
          {
            offset: "65px",
            skin: "layui-layer-admin",
          },
          function (i) {
            layer.close(i);
            layer.load(2);
            admin.req(
              "production/quality/admin/workOrderQualityTask/close/" + data.id,
              // { id: data.id, status: "close" },
              {  },
              function (res) {
                layer.closeAll("loading");
                if (res.code == 200) {
                  layer.msg(res.msg, { icon: 1 });
                  table.reload("workOrderQualityTaskTable");
                } else {
                  layer.msg(res.msg, { icon: 2 });
                }
              },
              "put"
            );
          }
        );
      }

      // 导出excel
      $("#workOrderQualityTestingTaskBtnExport").click(function () {
        var checkRows = table.checkStatus("workOrderQualityTaskTable");
        if (checkRows.data.length == 0) {
          layer.msg("请选择要导出的数据", { icon: 2 });
        } else {
          table.exportFile(insTb.config.id, checkRows.data, "xls");
        }
      });

      // 打印
      function doPrint(obj) {
        layer.confirm(
          "确定要打印吗？",
          {
            offset: "65px",
            skin: "layui-layer-admin",
          },
          function (i) {
            layer.close(i);
            layer.load(2);
            admin.req(
              "production/qualityTesting/admin/workOrderQualityTestingTask/printLabels",
              { id: obj.data.id },
              function (res) {
                layer.closeAll("loading");
                if (res.code == 200) {
                  layer.msg(res.msg, { icon: 1 });
                } else {
                  layer.msg(res.msg, { icon: 2 });
                }
              },
              "get"
            );
          }
        );
      }

      // 打印入库签收单
    function showPrintPurchaseSignForTemplate(data) {
      admin.open({
        type: 1,
        area: ["1060px", "800px"],
        offset: '65px',
        title: '产品检验单',
        content: $('#printPurchaseSignForTemplate').html(),
        success: function () {
          let html = "";
          admin.req("production/quality/admin/workOrderQualityTask/getTaskDetailRecord?taskId="+data.id, {}, function (res) {
            if (res.code === 200) {
              let detailList = res.data;
              let itemData = res.data
              let customerObj = {}, auditName = '';
              // admin.reqSync("enterprise/sell/admin/contactInfo/list", {selCustomerId: res.data.customerId}, function (obj) {
              //   if (obj.code == 200) {
              //     customerObj = obj.data.length > 0 ? obj.data[0] : {};
              //   }
              // });
              // // 获取审核人
              // admin.reqSync("user/admin/user/list", {limit: 9999}, function (obj) {
              //   if (obj.code == 200) {
              //     auditName = obj.data.find(v => v.id === res.data.auditId).name || '';
              //   }
              // });
              html += `<div class="print-title">产品检验单</div>
          <div class="flexCt print-tip-info">
            <div class="company">编号:${data.code}</div>
            <div class="time">${data.createTime}</div>
          </div>
          <div class="print-table">
            <div class="print-view">
                  <div class="print-nape">
                    <div class="cell flex-1">
                        <div class="name flex-1">任务编号</div>
                        <div class="name flex-1">${data.code || ''}</div>
                        <div class="name flex-1">质检类型</div>
                        <div class="name flex-1">${data.qcQualityTypeName || ''}</div>
                        <div class="name flex-1">开工单</div>
                        <div class="name flex-1">${data.workOrderCode || ''}</div>
                        <div class="name flex-1">样品数</div>
                        <div class="name flex-1">${itemData.submissionQuantity || ''}</div>
                    </div>
                </div>

                <div class="print-nape">
                    <div class="cell flex-1">
                        <div class="name flex-1">所属计划</div>
                        <div class="name flex-1">${itemData.planCode || ''}</div>
                        <div class="name flex-1">送检工站</div>
                        <div class="name flex-1">${itemData.deviceCode || ''}</div>
                        <div class="name flex-1">载具编码</div>
                        <div class="name flex-1">${itemData.carrierCode || ''}</div>
                        <div class="name flex-1">质检类型</div>
                        <div class="name flex-1">${data.qcQualityTypeName || ''}</div>
                    </div>
                </div>

                <div class="print-nape">
                    <div class="cell flex-1 bac">
                        <div class="name flex-1">物料类型</div>
                        <div class="name flex-1">${itemData.productTypeName || ''}</div>
                        <div class="name flex-1">质检分类</div>
                        <div class="name flex-1">${data.testingCategoryName || ''}</div>
                        <div class="name flex-1">物料编码</div>
                        <div class="name flex-1">${itemData.skuCode || ''}</div>
                        <div class="name flex-1">物料名称</div>
                        <div class="name flex-1">${itemData.skuName || ''}</div>
                    </div>
                </div>

             

              

             
                  <div class="print-nape">
                    <div class="cell flex-1">
                        <div class="name flex-1">质检明细</div>
                    </div>
                </div>
              
              
              <div class="print-nape">
                <div class="cell  flex-1 bac">
                  <div class="th v-60" style="padding: 0">序号</div>
                  <div  class="name flex-1">样品编码</div>
                  <div  class="name flex-1">检测结果</div>
                   <div class="name flex-1">检测人</div>
                  <div class="name flex-1">检测时间</div>
                  <div class="th" style="padding: 0;">状态</div>
                  <div class="name flex-1">备注</div>
                  
                </div>
              </div>`;
              let list = detailList.length > 10 ? detailList.slice(0, 10) : detailList;
              let fillValue = {}, allMoney = new Decimal(0);
              // let filledArray = [...list, ...Array.from({ length: 10 - list.length }, () => fillValue)]||[];
              let filledArray = res.data.taskDetailInfoVos;
                filledArray.forEach((item, index) => {
                    if (item.totalMoney) {
                        allMoney = allMoney.add(new Decimal(item.totalMoney));
                    }
                    
                    // 判断当前行是奇数还是偶数
                    const isEvenRow = index % 2 === 1; // 双数行（index从0开始，所以 index % 2 === 1 表示偶数行）
                    const rowClass = isEvenRow ? "cell w-100 bac" : "cell w-100";
                    
                    html += `<div class="print-nape">
                        <div class="${rowClass}">
                            <div class="td v-60" style="padding: 0">${index + 1}</div>
                            <div class="name flex-1">${item.sampleCode || ''}</div>
                            <div class="name flex-1">${item.qualityTestingResultName || ''}</div>
                            <div class="name flex-1">${item.modifierName || ''}</div>
                            <div class="name flex-1">${item.updateTime || ''}</div>
                            <div class="td">${item.statusDesc || ''}</div>
                            <div class="name flex-1">${item.remark || ''}</div>
                        </div>
                    </div>`;
                });
              html += `<div class="print-nape nape-btm">
               
                  <div class="cell flex-1 bac">
                    <div class="name flex-1 ">质检人</div>
                    <div class="name flex-1">${itemData.creatorName}</div>
                    <div class="name flex-1 ">送检工站</div>
                    <div class="name flex-1">${itemData.deviceCode}</div>
                      <div class="name flex-1 ">质检时间</div>
                    <div class="name flex-1">${itemData.createTime}</div>
           
                </div>
                </div>
              </div>
            </div>
          </div>`
              $('#printHtml').html(html);

              $("#printPurchaseSignFor").click(function () {
                $('#printHtml').print({
                  debug: false,
                  importCSS: true,
                  printContainer: true,
                  operaSupport: false
                });
              })
            }
          });
        }
      })
    }
    });
</script>
